package com.clinic.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;

@Entity
@Inheritance(strategy = InheritanceType.JOINED)
public class Super_type implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private int se_obj_id = 0;
	@Column(length = 64)
	private String object_type;
	private Date creation_date;
	@Column(length = 128)
	private String obj_owner_name;

	public Super_type() {
		this.object_type = getClass().getSimpleName();
		this.creation_date = new Date();
	}

	public Super_type(String obj_owner_name) {
		this.object_type = getClass().getSimpleName();
		this.obj_owner_name = obj_owner_name;
		this.creation_date = new Date();
	}

	public int getSe_obj_id() {
		return se_obj_id;
	}

	public String getObject_type() {
		return object_type;
	}

	public Date getCreation_date() {
		return creation_date;
	}

	public String getObj_owner_name() {
		return obj_owner_name;
	}

	public void setObj_owner_name(String obj_owner_name) {
		this.obj_owner_name = obj_owner_name;
	}

	public void _toString() {
		System.out.println("Enter - _toString");
		System.out.println("object_type: " + this.object_type
				+ "\ncreation_date: " + this.creation_date
				+ "\nobj_owner_name: " + this.obj_owner_name);
		System.out.println("Exit - _toString");
	}
}